package service;

import dao.BillMapper;
import dao.ProviderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import pojo.Bill;
import pojo.Provider;

import javax.annotation.Resource;
import java.util.List;

@Service("billService")
@Transactional
public class BillServiceImpl implements BillService {

    @Resource(name="billMapper")
    private BillMapper billMapper;

    public boolean add(Bill bill) {
        return billMapper.add(bill) > 0;
    }

    @Override
    public List<Bill> getBillList(Bill bill) {
        return billMapper.getBillList(bill);
    }

    @Override
    public boolean deleteBillById(String delId) {
        return billMapper.deleteBillById(delId) > 0;
    }

    @Override
    public Bill getBillById(String id) {
        return billMapper.getBillById(id);
    }

    @Override
    public boolean modify(Bill bill) {
        return billMapper.modify(bill) > 0;
    }



}
